from django.db import models

# Create your models here.

from django.db import models

class HealthFAQ(models.Model):
    question = models.TextField(verbose_name='健康问题')
    answer = models.TextField(verbose_name='专业回答')
    created_at = models.DateTimeField(auto_now_add=True, verbose_name='创建时间')
    updated_at = models.DateTimeField(auto_now=True, verbose_name='更新时间')

    def __str__(self):
        return self.question[:50]  # 返回问题的前50个字符作为摘要

    class Meta:
        verbose_name = '健康问答'
        verbose_name_plural = '健康问答集'
        ordering = ['-created_at']  # 按创建时间倒序排列